package starter.stepdefinitions.orangehrmlive;

/**
 * @ClassName LoginPageStepdefs
 * @Date 2024/10/29 10:51 35
 * @Author Jack Chen
 * @Description serenity-cucumber-page-objects-starter-master
 * @Version 1.0
 */
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import net.serenitybdd.annotations.Steps;
import starter.actions.orangehrmlive.LoginPageSteps;

public class LoginPageStepdefs {

    @Steps
    LoginPageSteps loginPageSteps;

    @Given("orangehrm website was opened in browser")
    public void orangehrmWebsiteWasOpen() {
        loginPageSteps.openOrangehrmLoginPage();
    }

    @Then("the login page shows")
    public void userLoginPageShows() {
        loginPageSteps.loginPageShows();
    }

    @Then("input user name {string}")
    public void enterName(String username) {
        loginPageSteps.inputUsername(username);
    }

    @Then("input user password {string}")
    public void enterPassword(String password) {
        loginPageSteps.inputUserPassword(password);
    }

    @And("click user logon commit button")
    public void clickLogonButton() {
        loginPageSteps.clickOnLogonCommitButton();
    }

    @Then("login page show username {string} warning")
    public void loginPageShowUsernameWarning(String msg) {
        loginPageSteps.verifyUsernameWarnMsg(msg);
    }

    @Then("login page show password {string} warning")
    public void loginPageShowPasswordWarning(String msg) {
        loginPageSteps.verifyPasswordWarnMsg(msg);
    }

    @Then("login page show {string} error message")
    public void loginPageShowErrorMessage(String msg) {
        loginPageSteps.verifyLoginPageShowErrorMsg(msg);
    }


}
